﻿using System.Collections.Generic;
using System.Linq;
using InvestmentIntelligence.DbModel.Models;
using InvestmentIntelligence.Extensions;

namespace InvestmentIntelligence.DbModel.CustomModels
{
    public class BondList
    {
        private static readonly HashSet<SecurityClass.Types> AllBonds = new HashSet<SecurityClass.Types>
                                                                       {
                                                                           SecurityClass.Types.ConvertibleBond,
                                                                           SecurityClass.Types.ConvertibleBondTRS,
                                                                       };

        public static bool Contains(SecurityClass.Types securityClass)
        {
            return AllBonds.Contains(securityClass);
        }

        public static ICollection<byte> AllBondCodes
        {
            get
            {
                return AllBonds.Select(t => (byte)t).ToArray(AllBonds.Count);
            }
        }

        public static IEnumerable<SecurityClass.Types> AllBondTypes
        {
            get
            {
                return AllBonds;
            }
        }
    }
}
